package collection;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;

public class CollectionDemo2 {
    public static void main(String[] args) {
        Collection c = new ArrayList();
        //Collection c = new HashSet();
        c.add(new Point(1,2));
        c.add(new Point(3,4));
        c.add(new Point(5,6));
        c.add(new Point(7,8));
        c.add(new Point(9,0));
        System.out.println(c);

        boolean b = c.add(new Point(1,2));//对于hashset
        System.out.println(b);
        System.out.println(c);

        Point point = new Point(1, 2);
        boolean b1 = c.contains(point);
        System.out.println("是否包含点point："+b1);

        boolean b2 = c.remove(point);
        System.out.println("是否移除点point："+b2);
        System.out.println(c);

    }
}
